import Vue from 'vue'
import Router from 'vue-router'
let  detail;
import {isMobile} from '@/utils'
Vue.use(Router)
export default new Router({
  mode: 'history',
	//fix bug 配置cdn publicPath后导致路由基本路径加上publicPath
  //base: process.env.BASE_URL,
  routes: [
    {
      path: '/',
      name: 'home',
      component: r => require.ensure([], () => r(require('@/views/home/index')), 'home')
    },{
			path: '/login',
			name: 'login',
			component: r => require.ensure([], () => r(require('@/views/login/index2')), 'login')
				
		},{
			path: '/register',
			name: 'register',
			component: r => require.ensure([], () => r(require('@/views/reg/index2')), 'login')
		},{
			path: '/recharge',
			name: 'recharge',
			component: r => require.ensure([], () => r(require('@/views/recharge/index')), 'Recharge')
		},{
			path: '/bindPhone',
			name: 'bindPhone',
			component: r => require.ensure([], () => r(require('@/views/reg/components/bindPhone')), 'bindPhone')
		},{
			path: '/forgetPassword',
			name: 'forgetPassword',
			component: r => require.ensure([], () => r(require('@/views/forgetPassword/index2')), 'login')
		},{
			path: '/moreRoomList',
			name: 'moreRoomList',
			component: r => require.ensure([], () => r(require('@/views/home_more/index')), 'roomlist')
		},{
			path: '/team_hall/:eng_name/:type',
			name: 'FamilyHall1MoreList',
			component: r => require.ensure([], () => r(require('@/views/family_hall/template1/more_list/index')), 'roomlist')
		}
		,{
			path:'/:eng_name/:roomid',
			name:'room',
			component:r => require.ensure([], () => r(require('@/views/detail/index')), 'roomdetail')
		},
		{
		path: '/404',
		component: () => import('@/views/404/index'),
		hidden: true,
		},
		{
			path:'/:eng_name',
			name:'familyHall',
			component: r => require.ensure([], () => r(require('@/views/family_hall/index')), 'familyHall')
		},
		{
			path:'/v1/auth/users/qqCallback',
			name:'qqAuthRedirect',
			component: r => require.ensure([], () => r(require('@/views/redirect/index')), 'redirect')
		},
		{
			path:'/v1/auth/users/wxCallback',
			name:'wxAuthRedirect',
			component: r => require.ensure([], () => r(require('@/views/redirect/index')), 'redirect')
		},
		{ path: '*', redirect: '/404'}
  ]
})
